<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="body">


         

            <h:form id="form">
       <p:growl id="messages1" showDetail="true" />

            <p:contextMenu for="treeSingle">
                <p:menuitem value="Add" update="treeSingle" actionListener="#{treeBean.addNode}" icon="ui-icon-search" />
                <p:menuitem value="View" update="messages1" actionListener="#{treeBean.displaySelectedSingle}" icon="ui-icon-search" />
                <p:menuitem value="Delete" update="treeSingle" actionListener="#{treeBean.deleteNode}" icon="ui-icon-close"/>
            </p:contextMenu>
                <p:panel header="Add Course" >  
                    <h:panelGrid columns="2">
                        <p:column>
                            <p:tree id="treeSingle" value="#{treeBean.root}" var="node" 
                                    selectionMode="single"
                                    selection="#{treeBean.selectedNode}"
                                    dynamic="true">
                                <p:treeNode>
                                    <h:outputText value="#{node}"/>
                                </p:treeNode>
                            </p:tree>
                        </p:column>




                
                            <p:column>

                                <h:panelGrid columns="2">
                                    <h:outputLabel value="#{bundle.CreateGroupTableLabel_idGroupTable}" for="idGroupTable" />
                                    <h:inputText id="idGroupTable" value="#{groupTableController.selected.idGroupTable}" title="#{bundle.CreateGroupTableTitle_idGroupTable}" required="true" requiredMessage="#{bundle.CreateGroupTableRequiredMessage_idGroupTable}"/>
                                    <h:outputLabel value="#{bundle.CreateGroupTableLabel_groupName}" for="groupName" />
                                    <h:inputText id="groupName" value="#{groupTableController.selected.groupName}" title="#{bundle.CreateGroupTableTitle_groupName}" />
                                </h:panelGrid>
                                <br />
                                <h:commandLink action="#{groupTableController.create}" value="#{bundle.CreateGroupTableSaveLink}" />
                                <br />
                                <br />
                                <h:commandLink action="#{groupTableController.prepareList}" value="#{bundle.CreateGroupTableShowAllLink}" immediate="true"/>
                                <br />
                                <br />
                                <h:link outcome="/index" value="#{bundle.CreateGroupTableIndexLink}"/>
                            </p:column>

                    </h:panelGrid>
                </p:panel>  
            </h:form>

        </ui:define>
    </ui:composition>
</html>